/*
 * Copyright (c) 2009. Silenus Consultoria, S.L.
 */
package es.silenus.detecta.dao;

import es.silenus.detecta.model.Council;
import es.silenus.detecta.model.CouncilGroup;

import java.util.List;
import java.util.Map;


/**
 * The council group DAO.
 *
 * @author <a href="mailto:malonso@silenus-consultoria.es">Mariano Alonso</a>
 * @since 08-may-2009 11:50:41
 */
public interface CouncilGroupDAO extends ReadWriteDAO<CouncilGroup, Long> {
	/**
	 * Finds all council groups an organization owns.
	 *
	 * @param organizationId the organization id.
	 *
	 * @return the list of council groups.
	 */
	public List<CouncilGroup> findByOrganization(int organizationId);

	/**
	 * Finds a council group given its code and organization id.
	 *
	 * @param name the name.
	 * @param organizationId the organization id.
	 *
	 * @return the council group.
	 */
	public CouncilGroup findByName(final String name, int organizationId);

	/**
	 * Finds councils associated with the given criteria.
	 *
	 * @param sample the sample criteria.
	 * @param start the start index.
	 * @param limit the limit index.
	 * @param sortFields the sort fields.
	 * @param sortDirections the sort directions.
	 *
	 * @return the page.
	 */
	public Page<Council> findAssociatedCouncils(
		final Map<String, Object> sample, int start, int limit, final String[] sortFields, final String[] sortDirections);

	/**
	 * Finds councils non associated with the given criteria.
	 *
	 * @param sample the sample criteria.
	 * @param start the start index.
	 * @param limit the limit index.
	 * @param sortFields the sort fields.
	 * @param sortDirections the sort directions.
	 *
	 * @return the page.
	 */
	public Page<Council> findNonAssociatedCouncils(
		final Map<String, Object> sample, int start, int limit, final String[] sortFields, final String[] sortDirections);

	/**
	 * Retrieves the removal information of entities with the given keys.
	 *
	 * @param keys the keys.
	 *
	 * @return the information requested.
	 */
	public List<Map<String, Object>> getRemovalInformation(final Long[] keys);

	/**
	 * Removes councils groups by keys.
	 *
	 * @param keys the keys.
	 */
	public void remove(final Long[] keys);
}
